﻿CREATE TABLE [dbo].[CiFolder] (
    [Id]           NVARCHAR (40)  NOT NULL,
    [ParentId]     NVARCHAR (40)  NULL,
    [FolderName]   NVARCHAR (200) NOT NULL,
    [StateCode]    NVARCHAR (50)  NULL,
    [Description]  NVARCHAR (800) NULL,
    [SortCode]     INT            NOT NULL,
    [Enabled]      INT            CONSTRAINT [DF__CiFolder__Enable__0BC6C43E] DEFAULT ((1)) NOT NULL,
    [DeleteMark]   INT            CONSTRAINT [DF_CiFolder_DeleteMark] DEFAULT ((0)) NOT NULL,
    [CreateOn]     DATETIME       CONSTRAINT [DF__CiFolder__Create__0CBAE877] DEFAULT (getdate()) NOT NULL,
    [CreateUserId] NVARCHAR (50)  NULL,
    [CreateBy]     NVARCHAR (50)  NULL,
    [ModifiedOn]   DATETIME       NULL,
    [ModifyUserId] NVARCHAR (50)  NULL,
    [ModifiedBy]   NVARCHAR (50)  NULL,
    CONSTRAINT [PK_CIFOLDER] PRIMARY KEY NONCLUSTERED ([Id] ASC),
    CONSTRAINT [FK_Folder_ParentID] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[CiFolder] ([Id])
);

